<?php namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Session;
use Illuminate\Database\Eloquent\SoftDeletes;

class LifeProduct extends Model {

	//
	protected $table = "life_product";
	protected $fillable = ['name', 'price','image_name','content'];
	public function collect()
	{
		$uid = Session::has('user') ? Session::get('user')['id'] : 0 ;
		return $this->hasOne("App\Models\Collecttion", "relate_id", "id")->where("type", 4)->where("uid", $uid);
	}

}
